<template>
    <div>
      <p>Counter: {{ counter }}</p>
      父子组件传值事件监听
      <EmitSubConpoment @increment="increment" @decrement="decrement" />
    </div>
  </template>
  
  <script setup lang="ts">
  import { ref } from 'vue';
  import EmitSubConpoment from './EmitSubConpoment.vue';
  
  const counter = ref(0);
  
  const increment = () => {
    counter.value++;
  };
  
  const decrement = () => {
    counter.value--;
  };
  </script>
  